package com.zhumo.sz.mapper;

import com.zhumo.sz.entity.area.BaseArea;
import com.zhumo.sz.entity.bus.BusLineInfo;
import com.zhumo.sz.provider.BatchInsertProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PublicMapper {


    @InsertProvider(type = BatchInsertProvider.class,method = "batchInsert")
    int addBaseArea(@Param("list") List<BaseArea> baseAreaList);

    @Select("select * from base_area")
    List<BaseArea> getAllArea();

//    @Select("select ipweb_district_code from base_area group by ipweb_district_code")
//    List<BaseArea> get();

    @Select("select ipweb_district_code from base_area where district_name = '#{districtName}' limit 1;")
    String getDistrictCodeByName(@Param("districtName") String districtName);
}
